//表单数据验证JS
export function formRule() {
    return {

        title: [
            {
                required: true,
                message: `请设置图文标题`,
                trigger: ['blur','change'],

            },

            {
                trigger: ['blur','change'],
                max: 100,
                message: `标题长度不能超过100个字符`

            },

        ],


        author: [
            {
                trigger: ['blur','change'],
                required: true,
                message: `请设置文章作者`
            },
            {
                trigger: ['blur','change'],
                max: 20,
                message: `图文作者名称不能超过20个字符`
            }
        ],

        digest: {
            trigger: ['blur','change'],
            required: true,
            max: 100,
            message: `请设置图文摘要 100个字符以内`

        },



        coverPicUrl: {
            trigger: ['blur','change'],
            required: true,
            message: `请上传一张封面图片`
        },


        typeCode:{
            trigger: ['blur','change'],
            required: true,
            message: `请设置图文所属分类`
        },

        sort:{
            trigger: ['blur','change'],
            required: false,
            type: "number",
            message: `图文显示排序必须为数字`
        },


        readCount:{
            required: false,
            type: "number",
            message: `阅读次数必须是数字`
        },


        shareCount:{
            trigger: ['blur','change'],
            required: false,
            type: "number",
            message: `分享次数必须是数字`
        },


        content:  {
            trigger: ['change'],
                required: true,
                message: `正文不能为空`
            }


    }
}
